package com.quectel.emp.controller.village;

import com.quectel.core.module.village.dto.VillageBuildingDto;
import com.quectel.core.module.village.service.VillageBuildingService;
import com.quectel.core.module.village.service.VillageFloorService;
import com.quectel.core.module.village.service.VillageService;
import com.quectel.emp.controller.BaseController;
import com.quectel.util.common.Response;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author caolu
 * @email louis.cao@quectel.com
 * @date 2021-10-18 14:40:54
 */
@RestController
@RequestMapping("villageBuilding")
@Tag(name = "VillageBuildingController", description = "相关api")
public class VillageBuildingController extends BaseController {
    @DubboReference
    private VillageService villageService;
    @DubboReference
    private VillageBuildingService villageBuildingService;
    @DubboReference
    private VillageFloorService villageFloorService;

    @GetMapping("queryByVillageId")
    @Operation(summary = "根据小区筛选楼栋")
    public Response<List<VillageBuildingDto>> queryByVillageId(
            @Parameter(description = "小区") @RequestParam Long villageId
    ) {

        return Response.<List<VillageBuildingDto>>ok().wrap(villageBuildingService.selectByVillageId(villageId));
    }

}
